package jp.peach_boys.sandbox.slim3.domain;

public enum Todoufuken {
    HOKKAIDO("hokkaido"),
    AOMORI("aomori"),
    AKITA("akita");
    private String key;
    private Todoufuken(String key){
        this.key = key;
    }
    public static Todoufuken get(String key){
        if(key == null){
            return HOKKAIDO;
        }
        for(Todoufuken entry: values()){
            if(key.equals(entry.key)){
                return entry;
            }
        }
        throw new IllegalArgumentException("key="+key);
    }
    public String getKey(){
        return key;
    }
}
